﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ActiveStory.UI
{
    /// <summary>
    /// Interaction logic for RenamePageDialog.xaml
    /// </summary>
    public partial class RenamePageDialog : Window
    {
        public String NewName
        {
            get
            {
                return NewNameTextBox.Text;
            }
        }

        public RenamePageDialog(String currentName, int pageNumber)
        {
            InitializeComponent();
            CurrentNameValLabel.Content = currentName;
            PageNumberValLabel.Content = pageNumber;
        }

        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            if(NewName.Length<1)
            {
                MessageBox.Show(this, "Invalid name. Name must be longer than 1 character.", "Invalid Name", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            DialogResult = true;
        }
    }
}
